export default {
    /*
    ** Nuxt target
    ** See https://nuxtjs.org/api/configuration-target
    */
    target: 'server',
    /*
    ** Headers of the page
    ** See https://nuxtjs.org/api/configuration-head
    */
    head: {
        title: process.env.npm_package_name || '',
        meta: [
            {charset: 'utf-8'},
            {name: 'viewport', content: 'width=device-width, initial-scale=1'},
            {hid: 'description', name: 'description', content: process.env.npm_package_description || ''}
        ],
        link: [
            {rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'}
        ]
    },
    /*
    ** Global CSS
    */
    css: [
        'element-ui/lib/theme-chalk/index.css'
    ],
    /*
    ** Plugins to load before mounting the App
    ** https://nuxtjs.org/guide/plugins
    */
    plugins: [
        {
            src: '@/plugins/world-cloud',
            ssr: false
        },
        {
            src: '@/plugins/element-ui',
            ssr: true
        },
        {
            src: '@/plugins/dateformat',
            ssr: true
        },
    ],
    /*
    ** Auto import components
    ** See https://nuxtjs.org/api/configuration-components
    */
    components: true,
    /*
    ** Nuxt.js dev-modules
    */
    buildModules: [],
    /*
    ** Nuxt.js modules
    */
    modules: [
        '@nuxtjs/axios',
        '@nuxtjs/proxy',
    ],
    axios: {
        proxy: true, // 表示开启代理
        credentials: true // 表示跨域请求时是否需要使用凭证 这个凭证不能打开 应该只需要打开代理
    },
    proxy: {
        '/user/': {
            // target: 'http://39.108.110.26:8080',
            target: 'http://localhost:8080',
            changeOrigin: true
        },
        '/portal/': {
            // target: 'http://39.108.110.26:8080',
            target: 'http://localhost:8080',
            changeOrigin: true
        },
        '/admin/': {
            // target: 'http://39.108.110.26:8080',
            target: 'http://localhost:8080',
            changeOrigin: true
        },
        '/shop/': {
            target: 'https://api.sunofbeach.net',
            changeOrigin: true
        },
    },
    /*
    ** Build configuration
    ** See https://nuxtjs.org/api/configuration-build/
    */
    build: {
        transpile: [/^element-ui/],
    }
}
